<template>
  <div class="wrap">
    <div class="item" @click="clickItem">
      <span class="numid">{{ item.id }}</span>
      <span class="name">{{ item.name }}</span>
      <span class="distance">{{ (item.distance / 1000).toFixed(2) }} km</span>
      <van-icon name="revoke" size="20"></van-icon>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    itemProperty: Object,
    require: true,
  },
  data() {
    return {
      item: {
        // id: 1,
        // name: '河南盛世管家家政服务有限公司',
        // lon: 123.5,
        // lat: 32.56,
        // distance: '12.222',
      },
    }
  },
  mounted() {
    this.$data.item = this.$props.itemProperty
  },
  methods: {
    clickItem() {
      this.$emit('clickListItem', this.$data.item)
    },
  },
}
</script>
<style lang="less" scoped>
.wrap {
  position: static;
  bottom: 0;
  height: 30%;
  background-color: slateblue;
}
.item {
  display: flex;
  justify-content: space-around;
  // position: relative;
  margin-bottom: 3px;
  // left: 0px;
  // top: 380px;
  width: 100%;
  height: 40px;
  line-height: 40px;
  font-size: 12px;
  border-bottom: 1px solid skyblue;
  background-color: paleturquoise;
  z-index: 900;
  //序号
  .numid {
    flex: 1;
    background-color: #fff;
    margin-top: 3px;
    margin-left: 3px;
    text-align: center;
    color: orangered;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
  }
  //名称
  .name {
    flex: 7;
    padding-left: 15px;
    text-align: left;
    font-size: 14px;
  }
  //距离
  .distance {
    flex: 2;
    color: blue;
    font-weight: 700;
  }
  //图标
  .van-icon {
    line-height: 38px;
    color: blue;
    font-weight: 700;
    padding-right: 5px;
  }
}
</style>
